import { BadRequestException, PipeTransform } from "@nestjs/common";
export class ParseFloatPipe implements PipeTransform<string> {
  transform(value: string) {
    const val = parseFloat(value);
    if (isNaN(val)) {
      throw new BadRequestException(
        "Validation failed (boolean string is expected))"
      );
    }
    return val;
  }
}
